import Vue from 'vue'
import VueRouter from 'vue-router'




Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home/page',
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/HomeView.vue'),
    children: [
      {
        path: 'page',
        component: () => import('@/components/home/HomePage.vue')
      },
      {
        path: 'list',
        component: () => import('@/components/user/UserList.vue')
      },
      {
        path: 'about',
        component: () => import('@/components/user/UserAbout.vue')
      },
      {
        path: 'news',
        component: () => import('@/components/user/UserNews.vue')
      },
    ]
  },
  {
    path: '/404',
    name: 'ErrorPage404',
    component: () => import('@/views/404.vue'),
    hidden: true
  },

  { path: '*', redirect: '/404', hidden: true }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
